{The routines in unit HeaderEdit control the HeaderForm, and permit the user}
{to change the title and descriptive information for the data definition S. }

unit HeaderEdit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, TitrDefs;

type
  THeaderForm = class(TForm)
    Label1: TLabel;
    TitleEdit: TEdit;
    Describe2: TEdit;
    Describe1: TEdit;
    Describe3: TEdit;
    ExitBtn: TButton;
    Procedure WriteScreen;
    procedure FormActivate(Sender: TObject);
    procedure Describe1Exit(Sender: TObject);
    procedure Describe2Exit(Sender: TObject);
    procedure Describe3Exit(Sender: TObject);
    procedure TitleEditExit(Sender: TObject);
    procedure ExitBtnClick(Sender: TObject);
    private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  HeaderForm: THeaderForm;

{****************************************************************************}
{****************************************************************************}



implementation

{$R *.dfm}

Procedure THeaderForm.WriteScreen;
begin
   TitleEdit.Text := S.Head.Title;
   Describe1.Text := S.Head.Descrip[1];
   Describe2.Text := S.Head.Descrip[2];
   Describe3.Text := S.Head.Descrip[3];
end;

procedure THeaderForm.FormActivate(Sender: TObject);
begin
   WriteScreen;
end;

procedure THeaderForm.Describe1Exit(Sender: TObject);
begin
    S.Head.Descrip[1] := Describe1.Text;
end;

procedure THeaderForm.Describe2Exit(Sender: TObject);
begin
    S.Head.Descrip[2] := Describe2.Text;
end;

procedure THeaderForm.Describe3Exit(Sender: TObject);
begin
   S.Head.Descrip[3] := Describe3.Text;
end;

procedure THeaderForm.TitleEditExit(Sender: TObject);
begin
   S.Head.Title := TitleEdit.Text;
end;


procedure THeaderForm.ExitBtnClick(Sender: TObject);
begin
    HeaderForm.Close;
end;

end.
